<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/* Description of Autoload
 * Ładuje klasy dla frameworka MVC ( powinny się one łądować same ale to nie JAVA :( )
 */

function __autoload($className){
    
    switch($className[0]){
        case 'c':
            require_once( './controller/' . $className . '.php');
            break;
        case 'm':
           require_once( './model/' . $className . '.php');
           break;
        case 'v':
            require_once( './view/' . $className . '.php');
           break;
        default :
            throw new Exception('Cannot found class ' . $className .' file to load');
    }
}